const express = require('express');
const router = express.Router();
const LikeController = require('../controllers/likeController');
const authMiddleware = require('../middleware/authMiddleware');

// Apply authentication middleware to all like routes
router.use(authMiddleware);

// Toggle like for a news article
router.post('/news/:newsId/like', LikeController.toggleLike);

// Unlike a news article
router.delete('/news/:newsId/like', LikeController.unlike);

// Get likes count for a news article
router.get('/news/:newsId/likes', LikeController.getLikesCount);

module.exports = router; 